<!--conf
<sample>
              <product version="2.6" edition="std"/>
                     <modifications>
                            <modified date="100609"/>
                     </modifications>
               </sample>
 -->
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
	<title>Events</title>
		<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
	<link rel="stylesheet" type="text/css" href="../../../codebase/dhtmlx.css"/>
	<script src="../../../codebase/dhtmlx.js"></script>
	
	<script src="../common/testdata.js"></script>
	<script>

	var barChart1;
	window.onload = function(){
		barChart1 =  new dhtmlXChart({
            view:"bar",
            container:"chart1",
            value:"#sales#",
            radius:2,
            gradient:"rising",
            width:40,
            tooltip:{
                template:"#sales#"
            },
            yAxis:{
                start:0,
                end:100,
                step:10,
                template:function(value){
                    return value%20?"":value
                }
            },
            xAxis:{
                template:"'#year#"
            }
        });
        barChart1.parse(dataset,"json");
        barChart1.attachEvent("onMouseMove", function(id){
            id = barChart1.get(id).year;
            log("onMouseMove", id);
            return true;
        });
        barChart1.attachEvent("onMouseOut", function(){
            log("onMouseOut");
            return true;
        });

        barChart1.attachEvent("onItemClick", function(id){
            id = barChart1.get(id).year;
            log("onItemClick", id);
            return true;
        });
        barChart1.attachEvent("onItemDblClick", function(id){
            id = barChart1.get(id).year;
            log("onItemDblClick", id);
            return true;
        });
	
	}

	function log(name, id){
		var t = document.createElement("DIV");
		t.innerHTML = name+(id?" for element "+id:"");
		
		var p = document.getElementById("log_div");
		p.insertBefore(t, p.firstChild);
	}

	</script>
</head>
<body>
	<div id="chart1" style="width:600px;height:250px;border:1px solid #A4BED4;"></div>
	<div id="log_div" style="widht:950px; height:300px; font-family:Tahoma;overflow:auto"></div>
	
	
</body>
</html>
